package com.yanggu.redisson.mq.consumer;

import com.yanggu.redisson.component.consumer.RedissonDelayedQueueListener;
import com.yanggu.redisson.domain.OrderData;
import lombok.extern.slf4j.Slf4j;
import org.dromara.hutool.core.date.DateTime;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TestConsumer {

    @RedissonDelayedQueueListener("test-delayed-queue1")
    public void handleMessage(String message) {
        log.info("Received message1: {}, 当前时间: {}", message, new DateTime());
    }

    @RedissonDelayedQueueListener("${delay-queue.name2}")
    public void handleMessage2(OrderData message) {
        log.info("Received message2:{}, 当前时间: {}", message, new DateTime());
    }

}